package com.share.module.sys.file.service;

import com.stock.mybatisplus.utils.PageUtils;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.share.module.sys.file.dao.FileDAO;
import com.share.module.sys.file.entity.FileEntity;

@Service
public class FileService extends ServiceImpl<FileDAO, FileEntity> {

    public PageUtils<FileEntity> page(Integer current, Integer size, String name) {
        IPage<FileEntity> page = super.page(new Page<>(current, size), Wrappers.<FileEntity>lambdaQuery()
                .like(FileEntity::getName, name));
        return new PageUtils(page);
    }

}
